package link.luyu.protocol.link.citahub;

import com.citahub.link.CITAConnection;
import com.citahub.link.CITADriver;
import java.util.Map;
import link.luyu.protocol.link.Connection;
import link.luyu.protocol.link.Driver;
import link.luyu.protocol.link.LuyuPlugin;
import link.luyu.protocol.link.PluginBuilder;

@LuyuPlugin("CITA")
public class CITAPluginBuilder extends PluginBuilder {
    @Override
    public Connection newConnection(Map<String, Object> properties) {
        try {
            return new CITAConnection(properties);
        } catch (Exception e) {
            System.out.println("CITAPluginBuilder newConnection exception: " + e.getMessage());
            return null;
        }
    }

    @Override
    public Driver newDriver(Connection connection, Map<String, Object> properties) {
        try {
            return new CITADriver(connection, properties);
        } catch (Exception e) {
            System.out.println("CITAPluginBuilder newDriver exception: " + e.getMessage());
            return null;
        }
    }
}
